﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="CurrData.Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>Index </title>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />


    <link href="/js/kd/styles/kendo.common.min.css" rel="stylesheet" />
    <link href="/js/kd/styles/kendo.blueopal.min.css" rel="stylesheet" />
    <link href="/js/fa/css/font-awesome.min.css" rel="stylesheet" />
    <link href="/js/site.css?t=20221031" rel="stylesheet" />

    <script src="/js/kd/jquery.min.js"></script>
    <script src="/js/kd/kendo.web.min.js"></script>

    <script src="/js/kd/cultures/kendo.culture.zh-CN.min.js"></script>
    <script src="/js/kd/messages/kendo.messages.zh-CN.min.js"></script>
    <script src="/js/kd/jszip.min.js"></script>


    <script src="/js/kendo_stdefine.js"></script>
    <script src="/js/site50.js"></script>

    <script src="/js/xlsx.full.min.js?t=1"></script>



</head>
<body>
    <div id="divSplitter" data-role="splitter"
         data-panes="[
             { collapsible: false, resizable: false },
             { collapsible: false, resizable: false,  size: '50px' }
          ]"
         data-orientation="vertical">

        <div id="center" style="overflow:hidden;padding-top:0px;overflow-y: auto;">
            <div style="height:10px;"></div>
            <form id="form1">
                <div class="flexrow">
                    <div class="tdLabel75">参数1</div>
                    <div class="tdValue">
                        <input id="CS1" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数2</div>
                    <div class="tdValue">
                        <input id="CS2" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数3</div>
                    <div class="tdValue">
                        <input id="CS3" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数4</div>
                    <div class="tdValue">
                        <input id="CS4" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数5</div>
                    <div class="tdValue">
                        <input id="CS5" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数6</div>
                    <div class="tdValue">
                        <input id="CS6" class="k-textbox"  />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数7</div>
                    <div class="tdValue">
                        <input id="CS7" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75">参数8</div>
                    <div class="tdValue">
                        <input id="CS8" class="k-textbox" />
                    </div>
                    <div style="width:20px;"></div>
                </div>

            </form>
            <div style="height:10px;"></div>


        </div>

        <div id="bottom" class="flexrow" style="  ">

            <div style="flex:1;">


            </div>
            <div style="width:100px;">


            </div>

            <div style="width:100px;">

            </div>

            <div style="width:100px;">
                <a href="javascript:btnOKonClick();" class="k-button" style="width:80px; " accesskey="S">

                    <i class="fa fa-save"></i>
                    <span style="text-decoration:underline;margin-left:5px;">S</span>
                    确定
                </a>
            </div>
            <div style="width:80px;">
                <a href="javascript:myWindowClose();" class="k-button" style="width: 80px;  " accesskey="C">
                    <i class="fa fa-close"></i>
                    <span style="text-decoration: underline; margin-left: 5px;">C</span>
                    取消

                </a>
            </div>
            <div style="width:20px;"></div>

        </div>

    </div>

    <script>
        var viewModel = new kendo.data.ObservableObject({
        });

        function Init() {
            $("#form1").kendoValidator(kendoValidatorOptions)
            kendo.bind($("#divSplitter"), viewModel);

        };
        function btnOKonClick() {
            var v = $("#form1").data("kendoValidator");
            if (v.validate() == false) return;

            var data = [];
            for (var i = 1; i <= 8; i++) {
                var v = $("#CS" + i.toString()).val();
                v = $.trim(v);
                if (v) {
                    data.push({ Id: i, Name: v });
                }
            }

            // 检查是否有重复
            for (var i = 0; i < data.length - 1; i++) {
                for (var j = i + 1; j < data.length; j++) {
                    if (data[i].Name == data[j].Name) {
                        myAlert(`参数${data[i].Name}重复`);
                        return;
                    }
                }
            }
            onOk(data);
        }

        function setData(data) {

            for (var i = 0; i < data.length; i++) {
                $("#CS" + (i + 1)).val(data[i].Name)
            }
            for (var i = 0; i < 8; i++) {
                $("#CS" + (i + 1)).attr('placeholder', `参数${i + 1}名称`)
            }

        }
    </script>

    <script>
        var SizeInfo;
        $(function () {

            kendo.culture("zh-CN");


            if (window.Init) {
                Init();
            }
        });
        function After50(d) {
            if (d) {
                setTimeout(function () { d(); }, 50);
            }
        }
    </script>
</body>
</html>
